﻿namespace TestWebApi.Entry
{
    public class Respone
    {
        private int code;
        private string message;
        private Object data;

        private Respone(int code , string message, Object data) { 
            this.code = code;
            this.message = message;
            this.data = data;
        }
        private Respone()
        {
            this.code = 200;
            this.message = "ok";
            this.data = null;
        }
        private Respone(int code, string message)
        {
            this.code = code;
            this.message = message;
        }
        public static Respone Ok(Object data)
        {
            return new Respone(200,"ok",data);
        }
        public static Respone Ok()
        {

            return new Respone();
        }

        public static Respone err(string errMessage)
        {
            return new Respone(500, errMessage);
        }
    }
}
